<?php


namespace GuanChanghu\Enum;

/**
 * Class StatusEnum
 * @method static $this underway()
 * @method static $this success()
 * @method static $this fail()
 * @package GuanChanghu\Enum
 */
class StatusEnum extends BaseEnum
{
    /**
     * 状态-进行中
     */
    public const STATUS_UNDERWAY = 0;

    /**
     * 状态标记-成功
     */
    public const STATUS_SUCCESS = 1;

    /**
     * 状态标记-失败
     */
    public const STATUS_FAIL = 2;

    /**
     * @return int[]
     */
    protected static function values(): array
    {
        return [
            'underway' => self::STATUS_UNDERWAY,
            'success' => self::STATUS_SUCCESS,
            'fail' => self::STATUS_FAIL,
        ];
    }

    /**
     * @return array|string[]
     */
    protected static function labels(): array
    {
        return [
            'underway' => function_exists('__') ? __('enums.status.underway') : '进行中',
            'success' => function_exists('__') ? __('enums.status.success') : '成功',
            'fail' => function_exists('__') ? __('enums.status.fail') : '失败',
        ];
    }
}
